home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / misc / emu / p-interp.lha / p-interp-0.4 / svolcvt.c < prev    next >
C/C++ Source or Header  |  2001-05-20  |  1KB  |  50 lines

  1. /*
  2.  
  3.   P-Code interpreter (to run the apple pascal system)
  4.   Copyright (C) 2000 Mario Klebsch
  5.  
  6.   This program is free software; you can redistribute it and/or modify
  7.   it under the terms of the GNU General Public License as published by
  8.   the Free Software Foundation; either version 2 of the License, or
  9.   (at your option) any later version.
  10.  
  11.   This program is distributed in the hope that it will be useful,
  12.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.   GNU General Public License for more details.
  15.  
  16.   You should have received a copy of the GNU General Public License
  17.   along with this program; if not, write to the Free Software
  18.   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  
  20.  
  21.   $Log: svolcvt.c,v $
  22.   Revision 1.3  2001/05/20 13:51:06  mario
  23.   Rückgabewert 0 in main() eingebaut, man-Page aktualisiert.
  24.  
  25.   Revision 1.2  2001/05/20 13:12:02  mario
  26.   CVS-Idents und Logs eingefügt
  27.  
  28.  
  29. */
  30.  
  31. #ident "$Id: svolcvt.c,v 1.3 2001/05/20 13:51:06 mario Exp $";
  32.  
  33. #include <stdio.h>
  34. #include <unistd.h>
  35.  
  36. # define SEC_SIZE    256
  37. # define SEC_PER_TRACK    16
  38. int table[SEC_PER_TRACK]={0,14,13,12,11,10,9,8,7,6,5,4,3,2,1,15};
  39.  
  40. int main(int argc, char *argv[])
  41. {
  42.   int        i;
  43.   unsigned char Buffer[SEC_SIZE*SEC_PER_TRACK];
  44.   
  45.   while (read(0,Buffer,sizeof(Buffer))==sizeof(Buffer))
  46.     for (i=0;i<SEC_PER_TRACK;i++)
  47.       write(1,Buffer+table[i]*SEC_SIZE,SEC_SIZE);
  48.   exit(0);
  49. }
  50.